jQuery(document).ready(function($){cookieSliderResize();$(window).resize(function(){cookieSliderResize();});$('.GLSetting, .GLSettingManage').click(function(e){e.preventDefault();$('.glCookieMessage').fadeOut();if($(window).width()<=750){$('.ScrollTop').trigger('click');if($('.glMainContainer.jspScrollable').length){var d=$('.glMainContainer').data('jsp');d.destroy();}} $('.glCookie,.glOverlay').fadeIn('fast',function(){setTimeout(cookieSliderResize(),500);});});$('#csglAllowAllCookies').click(function(e){e.preventDefault();$('.glCookieMessage').fadeOut();$.cookie('CookieConsent','2',{expires:365,path:'/'});});$('.csglCancel').click(function(e){e.preventDefault();$('.glCookie,.glOverlay').fadeOut();});if($.cookie('CookieConsent')==undefined){$.each($.cookie(),function(el){$.removeCookie(el);});$('.glCookieMessage').show();} if($.cookie('CookieConsent')!=undefined){var v=$.cookie('CookieConsent');if(v=="2"){$('.glRow div.icon2').addClass('active');$('.glRow div.icon3').addClass('active');}else if(v=="1"){$('.glRow div.icon2').addClass('active');$('.glRow div.icon3').removeClass('active');}else if(v=="0"){$('.glRow div.icon2').removeClass('active');$('.glRow div.icon3').removeClass('active');} $('#hfGLCookieValue').val(v);setTexts(v);} var html="<h2>Stricly Necessary</h2><p>'Strictly Necessary' cookies let you move around the website and use essential features like secure areas, shopping baskets and online billing. <strong>These cookies don't gather any information about you that could be used for marketing or remembering where you've been on the internet.</strong></p>";global.tooltip.init($('.icon1'),html,$('.icon1'));html="<h2>Functionality</h2><p>'Functionality' cookies are used to provide services or to remember settings to improve your visit.</p>";global.tooltip.init($('.icon2'),html,$('.icon2'));html="<h2>Statistical</h2><p>'Statistical' cookies are linked to services provided by third parties, such as 'Like' buttons and 'Share' buttons. The third party provides these services in return for recognising that you have visited our website.</p>";global.tooltip.init($('.icon3'),html,$('.icon3'));function cookieSliderResize(){var ww=$(window).width();var glc=$('.glCookie');var hf=$('#hfGLCookieValue');var mask=$('.mask');if(ww>750)glc.css({left:(ww-glc.outerWidth())/2});else glc.css('left','');var t=$('.glContainer img');if(hf.val()=='0'){t.css({left:-23});mask.width(0);setTexts("0");$('.glicon2').removeClass('active');$('.glicon3').removeClass('active');}else if(hf.val()=='1'){t.css({left:187});mask.width(210);setTexts("1");if(!$('.glicon2').hasClass('active'))$('.glicon2').addClass('active');$('.glicon3').removeClass('active');}else{t.css({left:400});mask.width(420);setTexts("2");if(!$('.glicon2').hasClass('active'))$('.glicon2').addClass('active');if(!$('.glicon3').hasClass('active'))$('.glicon3').addClass('active');} if(ww>750){t.draggable({containment:'.glContainer',stop:function(event,ui){if(parseInt(t.css('left'))<82){t.animate({left:-23},500);mask.animate({width:0},500);$('.glicon2').removeClass('active');$('.glicon3').removeClass('active');hf.val(0);setTexts("0");} else if(parseInt(t.css('left'))<292){t.animate({left:187},500);mask.animate({width:210},500);if(!$('.glicon2').hasClass('active'))$('.glicon2').addClass('active');$('.glicon3').removeClass('active');hf.val(1);setTexts("1");}else{t.animate({left:400},500);mask.animate({width:420},500);if(!$('.glicon2').hasClass('active'))$('.glicon2').addClass('active');if(!$('.glicon3').hasClass('active'))$('.glicon3').addClass('active');hf.val(2);setTexts("2");}},drag:function(event,ui){mask.width(ui.position.left+23);}});$('li.glCookieIcon1').unbind().click(function(){t.animate({left:-23},500);mask.animate({width:0},500);hf.val(0);setTexts("0");cookieSliderResize();;});$('li.glCookieIcon2').unbind().click(function(){t.animate({left:187},500);mask.animate({width:210},500);hf.val(1);setTexts("1");cookieSliderResize();;});$('li.glCookieIcon3').unbind().click(function(){t.animate({left:400},500);mask.animate({width:420},500);hf.val(2);setTexts("2");cookieSliderResize();;});} else{$('li.glicon1').unbind().click(function(){t.css('left',-23);mask.css('width',0);$('.glicon2').removeClass('active');$('.glicon3').removeClass('active');hf.val(0);setTexts("0");cookieSliderResize();;});$('li.glicon2').unbind().click(function(){t.css('left',187);mask.css('width',210);if(!$('.glicon2').hasClass('active'))$('.glicon2').addClass('active');$('.glicon3').removeClass('active');hf.val(1);setTexts("1");cookieSliderResize();;});$('li.glicon3').unbind().click(function(){t.css('left',400);mask.css('width',420);if(!$('.glicon2').hasClass('active'))$('.glicon2').addClass('active');if(!$('.glicon3').hasClass('active'))$('.glicon3').addClass('active');hf.val(2);setTexts("2");cookieSliderResize();;});}} function setMainHeight(){$('.glMainContainer,.glCookie').each(function(){$(this).css('height','');});var w=$(window).width();var h=$(window).height();if($('.glMainContainer.jspScrollable').length&&w<=750){var d=$('.glMainContainer').data('jsp');d.destroy();} if(w>750){var heightToKeep=$('.glCookie .glHeadText').height()+$('.glCookie .glButtons').height()+$('.glCookie .glFooter').height()+70;if($('.glCookie').outerHeight(false)>h){$('.glCookie').outerHeight(h);$('.glMainContainer').outerHeight(h-heightToKeep-40);}} else{$('.glMainContainer,.glCookie').each(function(){$(this).css('height','');});}} function setTexts(v){var nessessary=['Make sure you connect to the right service on our website when we make any changes to the way the website works'];var functionality=['Remember if we\'ve already asked you if you want to fill in a survey','Provide proactive live chat sessions to offer you support','Show you when you\'re logged in to the website','Share information with partners to provide a service on our website. The information shared is only to be used to provide the service, product or function and not for any other purpose','Remember results of tests performed to make the website more relevant to you'];var statistical=['Link to social networks like Facebook, who may subsequently use information about your visit to target advertising to you on other websites','Provide advertising agencies with information on your visit so that they can present you with adverts that you may be interested in when you return to our website or visit other third party websites','Deliver content and marketing communications tailored to your interests based on information from your visit'];$('.glDescription .glContent').empty().append("<ul/>");for(var i=0;i<nessessary.length;i++){$('.glDescription .glOKSection .glContent ul').append("<li>"+nessessary[i]+"</li>");} if(v==="2"){for(var i=0;i<functionality.length;i++){$('.glDescription .glOKSection .glContent ul').append("<li>"+functionality[i]+"</li>");} for(var i=0;i<statistical.length;i++){$('.glDescription .glOKSection .glContent ul').append("<li>"+statistical[i]+"</li>");}}else if(v==="1"){for(var i=0;i<functionality.length;i++){$('.glDescription .glOKSection .glContent ul').append("<li>"+functionality[i]+"</li>");} for(var i=0;i<statistical.length;i++){$('.glDescription .glNoSection .glContent ul').append("<li>"+statistical[i]+"</li>");}}else if(v==="0"){for(var i=0;i<functionality.length;i++){$('.glDescription .glNoSection .glContent ul').append("<li>"+functionality[i]+"</li>");} for(var i=0;i<statistical.length;i++){$('.glDescription .glNoSection .glContent ul').append("<li>"+statistical[i]+"</li>");}} setTimeout(setMainHeight(),1000);} $(".csglSubmit").click(function(e){e.preventDefault();var l=$(this);if(!l.hasClass("inTransition")){l.parent().slideUp(250);l.parent().parent().find(".glButtonsLoader").slideDown(250);l.addClass("inTransition");$.post(cookieSliderglAjax.ajaxurl,{action:'ajaxSaveCookiesSelectorGL',data:$('#hfGLCookieValue').val()},function(response){l.removeClass("inTransition");if($('#hfGLCookieValue').val()!=2){$.each($.cookie(),function(el){if(response.indexOf(el+";")>=0){}else{$.cookie(el,"",{expires:-365,path:'/'});$.cookie(el,"",{expires:-365});$.removeCookie(el);}});} $.cookie('CookieConsent',$('#hfGLCookieValue').val(),{expires:365,path:'/'});location.reload();});}});});(function($){var GLOBAL={init:function(){window.global=this;},tooltip:{init:function(wrapper,html,elem){var setting={wrapper:null,container:null,elem:null,html:null} var _this=this;setting.elem=elem;setting.wrapper=wrapper;setting.html=html;this.hover(setting);},hover:function(setting){var _this=this;setting.elem.unbind().hover(function(e){setting.wrapper.css({'position':'relative'}) setting.container=$('<div/>').addClass('tooltip');setting.container.html(setting.html);setting.container.appendTo(setting.wrapper);setting.elem.removeClass('open').addClass('close')},function(){_this.hide(setting)});},hide:function(setting){setting.elem.removeClass('close').addClass('open');if(setting.container!=null)setting.container.fadeOut(300,function(){$(this).remove();});}}} GLOBAL.init();})(jQuery);